package com.jm.service.Impl;

import java.util.List;

import javax.annotation.Resource;

import com.jm.dao.UserDao;
import com.jm.pojo.User;
import com.jm.pojo.UserLog;
import com.jm.service.UserService;

public class UserServiceImpl implements UserService{

	UserDao userDao ;
	
	
	public UserDao getUserDao() {
		return userDao;
	}
	
	@Resource(name="userDao")
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	@Override
	public List<User> checkUserExist(String name) {
		
		return userDao.selectUsersByName(name);
	}

	@Override
	public boolean deleteUser(String name) {
		return userDao.deleteDateByName(name);
	}

	@Override
	public List<User> getAllUsers() {
		List list = userDao.selectData();
		return list;
	}

	@Override
	public boolean saveUser(User u) {
		return userDao.insertData(u);
	}

	@Override
	public int changeUser(User u) {
		return userDao.alterDataByName(u);
	}

	@Override
	public void saveUserLog(UserLog ul) {
		userDao.saveUserLog(ul);
		
	}

	

}
